package zoo.controller;

import java.util.Map;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author HuangSuip
 */
@RestController
public class ConsumerController {

    private final IdClient idClient;

    public ConsumerController(IdClient idClient) {
        this.idClient = idClient;
    }

    @RequestMapping(value = "/getId", method = RequestMethod.GET)
    public Map add() {
        return idClient.nextId();
    }
}